<?php
$title = "OnlineShop-Shopping Design";
$css = "design.css";
include_once 'common/top.php';
include_once '../Class/DB.php';
$db=new DB();
$uid=$_SESSION["User"]["uid"];
$theDesign=$db->get_uid_decorate($uid);
?>
<div id="design">

	<script src="../js/design.js" type="text/javascript"></script>

	<div id="swf">
	<table class="totalTable">
		<tr>
		<td>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
					width="550" height="400" id="swfm">
				<param name="movie" value="../flash/compare.swf"/>
				<param name="allowScriptAccess" value="always"/>
				<param name="allowFullScreen" value="false"/>
				<param name="quality" value="high"/>
				<param name="wmode" value="transparent"/>
				<embed name="swfm" src="../flash/compare.swf"
						quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
						type="application/x-shockwave-flash"
						width="550" height="400"
						allowScriptAccess="always" wmode="transparent">
				</embed>
			</object>
		</td>
		<td valign="top">
		<div class=" tips">
			<!-- 注意注意注意注意注意，这里是已存在商品清单！！！ -->
			<table id="foodList">
				<tr>
					<th>
						<p>Product Id</p>
					</th>
					<th>
						<p>Product Name</p>
					</th>
					<!-- <th>
						<p>数量（个）</p>
					</th> -->
					<th>
						<p>Price</p>
					</th>
				</tr>
				
				<!-- <tr>
					<td>
						<p>1</p>
					</td>
					<td>
						<p>无敌小强桌</p>
					</td>
					<td>
						<p>100.25</p>
					</td>
				</tr> -->
			</table>
		</div>
		<div class="link">
			<a href="#" onclick="put_in_cart();">>>Put Into My Cart<<</a>
		</div>
		</td>
		</tr>
	</table>
	</div>
	<!--  <input type="button" value="clickMe" onclick="callFromFlash();">-->
	
	<div id="p_table" align="center" style=ttext-align:center;">
	<table border="1" >
		<tr>
			<th style="width:100px">
				<p>Product Id</p>
			</th>
			<th style="width:200px">
				<p>Product Name</p>
			</th>
			<th style="width:70px">
				<p>Decorate</p>
			</th>
		</tr>
		<?php 
		$i=0;
		while($theDesign[$i]){
			$theProduct=$db->get_pid_product($theDesign[$i]["pid"]);
			$theType=$db->get_tid_types($theProduct[0]["type"]);
		?>
		<tr>
			<td>
				<p><?php echo $theProduct[0]["pid"];?></p><input type="hidden" id="left_pid_<?php echo $theProduct[0]["pid"];?>" value="<?php echo $theProduct[0]["count"];?>" />
			</td>
			<td>
				<p><?php echo $theProduct[0]["p_name"];?></p>
			</td>
			<td>
			<?php if($theType[0]["name"]!="Floor"){?>
				<a	href="#" onclick="addFood('../flash/mode/furniture/<?php echo $theProduct[0]["pid"];?>.swf', <?php echo $theProduct[0]["pid"];?>, '<?php echo $theProduct[0]["p_name"];?>', <?php echo $theProduct[0]["act_price"];?>);">
					Add
				</a>
				<?php }else{?>
				<a	href="#" onclick="addFloor('../flash/mode/floor/<?php echo $theProduct[0]["pid"];?>.png', <?php echo $theProduct[0]["pid"];?>, '<?php echo $theProduct[0]["p_name"];?>',  <?php echo $theProduct[0]["act_price"];?>);">
					Add
				</a>
				<?php }?>
			</td>
		</tr>
		<?php 
		$i++;
		}
		?>

		<?php 
		/*$i=0;
		while($products[$i]!=null)
		{
		?>
		<tr align="center">
			<td>
				<p><?php echo $i;?></p>
			</td>
			<td>
				<p><?php echo $products[$i]["p_name"];?></p>
			</td>
			<td>
				<input type="button" name="btn_<?php echo $products[$i]["pid"]?>" 
				value="" onclick="callFromFlash('<?php echo $products[$i]["flash"];?>');"/>
			</td>
		</tr>	
		<?php 
			$i++;
		}*/
		?>
	</table>
</div>
</div>
<?php
include_once 'common/tail.php';
?>